import { z } from 'zod'

import { baseManyObjectsScheme, baseSchemeWithNote } from '@/types/base.types'

import { dayjsStrValidator } from '@/utils/customValidators'

export const reclamationScheme = baseSchemeWithNote.extend({
	number_in_program: z.string(),
	discovered_on: dayjsStrValidator,
	remediation_date: dayjsStrValidator.nullable(),
	warranty: z.number(),
	contract: z.number(),
	attachs: z.number()
})

export type IReclamation = z.infer<typeof reclamationScheme>

export const reclamationsScheme = baseManyObjectsScheme.extend({
	results: z.array(reclamationScheme)
})

export type IReclamations = z.infer<typeof reclamationsScheme>
